import TipsVue from './index.vue'

const Tips = {};

Tips.install = function (Vue, option) {
  const TipsInstance = Vue.extend(TipsVue);
  let name;
  const initInstance = () => {
    name = new TipsInstance();
    let nameSpan = name.$mount().$el;
    document.body.appendChild(nameSpan);
  }
  Vue.prototype.$Tips = {
    Tipshow(option){
      var tip_box=document.getElementsByClassName('tips-box');
      if(tip_box.length){
        return;
      }
      initInstance();
    //   if(typeof option === 'string'){
    //     name.firstName = option;
    //   }else if(typeof option === 'object'){
    //     Object.assign(name, option);
    //   }
        name.title=option
        return initInstance;
    }
  };
}

export default Tips;
